﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="temperatur.WebForm1" ViewStateMode="Disabled" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ValidationSummary ID="ValidationSummary1" runat="server" Visible="true" 
            Enabled="true" HeaderText="FEL!" ForeColor="Red"/>
        Starttemperatur:
        <br />
        <asp:TextBox ID="starttemp" runat="server"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Starttemperatur måste vara ifylld" ControlToValidate="starttemp"></asp:RequiredFieldValidator> 
        <asp:CompareValidator ID="CompareValidator1" runat="server" 
            ErrorMessage="Måste vara heltal" Type="Integer" ControlToValidate="starttemp" 
            Operator="DataTypeCheck"  ></asp:CompareValidator>
          
        <br />
        Sluttemperatur:
        <br />
        <asp:TextBox ID="sluttemp" runat="server"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Sluttemperatur måste vara ifylld" ControlToValidate="sluttemp"   ></asp:RequiredFieldValidator>
        <asp:CompareValidator ID="CompareValidator2" runat="server" 
            ErrorMessage="Måste vara heltal större än starttemperaturen" Type="Integer" 
            ControlToValidate="sluttemp" ControlToCompare="starttemp" 
            Operator="GreaterThan"  SetFocusOnError="True" ></asp:CompareValidator>
        <br />
        Temperatursteg:
        <br />
        <asp:TextBox ID="tempsteg" runat="server"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Temperatursteg får inte vara tomt" ControlToValidate="tempsteg" ></asp:RequiredFieldValidator>
        <asp:RangeValidator ID="RangeValidator1" runat="server" 
            ErrorMessage="Måste vara mellan 1-100" MinimumValue="1" MaximumValue="100" 
            ControlToValidate="tempsteg" Display="Dynamic" SetFocusOnError="True" 
            Type="Integer"  ></asp:RangeValidator>
        <asp:CompareValidator ID="CompareValidator3" runat="server" 
            ErrorMessage="Måste vara ett heltal" Type="Integer" Operator="DataTypeCheck" 
            ControlToValidate="tempsteg"  ></asp:CompareValidator>
        <br />
        Typ av konvertering
        <br />
        <asp:RadioButton ID="CtoF" runat="server" Text="Celsius till Fahrenheit" GroupName="konverteringstyp" Checked="true"/>
        <br />
        <asp:RadioButton ID="FtoC" runat="server" Text="Fahrenheit till Celsius" GroupName="konverteringstyp"/>
        <br />
        <asp:Button ID="Button1" runat="server" Text="Konvertera" 
            onclick="Button1_Click" />
        <br />
        <asp:Table ID="TempTable" runat="server" HorizontalAlign="Justify" 
            BorderStyle="Dashed" Visible="False" BackColor="Silver"  ></asp:Table>

        </div>
    </form>
</body>
</html>
